package com.stus.mapper;

import com.stus.model.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Repository;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by Alias on 2016/4/6.
 */
@Repository
public class UsersMapper implements RowMapper<Users> {
    @Autowired
    private Users users;
    @Override
    public Users mapRow(ResultSet rs, int rowNum) throws SQLException {
        users.setUsername(rs.getString("username"));
        users.setPassword(rs.getString("password"));
        return users;
    }
}
